<?php 
/**
 * Description of form
 * @author diotheos
 * @since 7 мая 2010
 */
class App_Form_User_Login extends Zend_Form
{
    /**
     * Initialization of form function
     *
     * @since 7 мая 2010
     * @author diotheos
     * @return Zend_Form
     */
    public function init()
    {
        parent::init();

        $this->setMethod('post');
        $this->setAction('');
        $this->setOptions(array('class' => 'des4forms'));

        $email = new Zend_Form_Element_Text('email');

        $email->setRequired()
                ->setLabel('Email:')
                ->setFilters(array(
                                  'StringToLower',
                                  'StringTrim'
                             ))
                ->addValidators(array(
                                     array('NotEmpty', true)
                                ));
        $email->setAttrib('class', 'text-input');
        $email->setAttrib('placeholder', 'Email');
        $email->setLabel('Email: ');
        $email->setDecorators(array('ViewHelper'));
        $this->addElement($email);

        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Password: ')
                ->setRequired()
                ->addValidators(array(
                                     array('NotEmpty', true)
                                ));
        $password->setAttrib('class', 'text-input');
        $password->setDecorators(array('ViewHelper'));
        $password->setLabel('Password: ');
        $password->setAttrib('placeholder', 'Password');
        $this->addElement($password);

        $remember = new Zend_Form_Element_Checkbox('remember');
        $remember->setDecorators(array('ViewHelper'));
        $this->addElement($remember);

//        $submit = new Zend_Form_Element_Submit('submit');
//        $submit->setLabel('Get in');
//        $submit->setAttrib('class', 'button');
//        $submit->setDecorators(array('ViewHelper'));
//        $this->addElement($submit);
        
        $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/user/login.phtml'))));

        return $this;
    }
}